import request from '@/utils/request'

// 教育背景API
export const educationApi = {
  // 根据ID查询教育背景
  queryById(id) {
    return request({
      url: `/admin/education/${id}`,
      method: 'GET'
    })
  },

  // 分页查询教育背景
  queryPage(pageNum, pageSize, params = {}) {
    return request({
      url: '/admin/education/page',
      method: 'POST',
      params: {
        pageNum,
        pageSize
      },
      data: params
    })
  },

  // 根据条件查询教育背景列表
  queryList(params) {
    return request({
      url: '/admin/education/list',
      method: 'POST',
      data: params
    })
  },

  // 创建教育背景
  create(data) {
    return request({
      url: '/admin/education',
      method: 'POST',
      data
    })
  },

  // 更新教育背景
  update(id, data) {
    return request({
      url: `/admin/education/${id}`,
      method: 'PUT',
      data
    })
  },

  // 删除教育背景
  delete(id) {
    return request({
      url: `/admin/education/${id}`,
      method: 'DELETE'
    })
  },

  // 批量删除教育背景
  deleteBatch(ids) {
    return request({
      url: '/admin/education/batch',
      method: 'DELETE',
      data: ids
    })
  }
}
